from random import *

from utils import *
dn = Dnconsole()

def clickNode(index, node, time: int = 0):
    if(node == None):
        return None
    bounds = node["bounds"]
    x1 = bounds[0][0]
    x2 = bounds[1][0]
    print(bounds, x1, x2)
    x = randint(x1, x2)
    y1 = bounds[1][0]
    y2 = bounds[1][1]
    y = randint(y1,y2)
    dn.touch(index, x,y, time)


def longClickNode(node):
    clickNode(node, 2000)